package edu.spec.wfl.week08.class1.book.unit4.one;

public class Cylinder extends Circle {
    private double hight;

    public Cylinder(double r,double h){
        super();
        this.setRadius(r);
        this.hight=h;
    }
    public double getVolume(){
        double volume=getArea()*hight;
        return volume;
    }
    public void showVolume(){
        System.out.println("圆柱体的体积是:\t"+getVolume());
    }

    public static void main(String[] args) {
        Circle c = new Circle(1);
        c.show();
        Cylinder cl=new Cylinder(2,3);
        cl.showVolume();
    }
}
